
function team.GetCommander( teamid )

	local players = team.GetPlayers( teamid )
	
	for _, v in pairs( players ) do
	
		if v:IsComm() then
			return v
		end
	
	end

end

team.GetComm = team.GetCommander

function team.GetValidTeams()

	local retur = {}

	for k, v in pairs( team.GetAllTeams() ) do
		if team.Joinable( k ) && k != TEAM_SPECTATOR then
			table.insert( retur, k )
		end	
	end

	return retur
end